package pl.com.sthaether.mc.engine.data;

import javafx.beans.property.ObjectProperty;
import javafx.beans.property.SimpleObjectProperty;
import javafx.beans.property.SimpleStringProperty;
import javafx.beans.property.StringProperty;
import javafx.scene.paint.Color;

public class MCSeriesColor {

    private ObjectProperty<Color> color;
    private StringProperty name;

    public MCSeriesColor(String name, Color color) {
        this.color = new SimpleObjectProperty<>(color);
        this.name = new SimpleStringProperty(name);
    }

    public Color getColor() {
        return color.get();
    }

    public void setColor(Color color) {
        this.color.set(color);
    }

    public ObjectProperty<Color> colorProperty() {
        return color;
    }

    public String getName() {
        return name.get();
    }

    public void setName(String name) {
        this.name.set(name);
    }

    public StringProperty nameProperty() {
        return name;
    }

    @Override
    public boolean equals(Object obj) {
        return obj instanceof MCSeriesColor && ((MCSeriesColor) obj).name.getValue().toLowerCase().equals(this.name.getValue().toLowerCase());
    }
}
